<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSmsRecordsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sms_records', function (Blueprint $table) {
            $table->id()->comment('短信发送记录表');
            $table->string('platform_account')->comment('短信平台账号');
            $table->integer('user_id')->comment('用户id')->index();
            $table->char('phone',15)->comment('接受短信的手机号');
            $table->text('content')->comment('短信内容');
            $table->string('add_ip',20)->comment('添加记录ip');
            $table->integer('template_id')->comment('消息模板id')->index();
            $table->tinyInteger('resultcode')->comment('状态码 100:成功,130:失败,131:空号,132:停机,133:关机,134:无状态');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sms_records');
    }
}
